package cn.com.sqlite.demo.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

public class BaseController {

	@ExceptionHandler
	public @ResponseBody String currentException(Exception e){
		Map<String, Object> exceptionMap = new HashMap<String,Object>();
		exceptionMap.put("code", 200);
		exceptionMap.put("error_code", -1);
		exceptionMap.put("error_info", e.toString());
		e.printStackTrace();
		return exceptionMap.toString();
	}
	
	public String success(){
		return "success";
	}
}
